package com.tedu.serverbill.controller;

import com.tedu.serverbill.UserAPIFeignClient;
import com.tedu.serverbill.UserQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BillController {
    //UserAPIFeignClient接口的实现类是由openFeign框架生成的动态代理类，
    //openfeign会自动为动态代理类生成对象，对象放在spring容器中
    //userAPIFeignClient的类型是？动态代理类
    //openfeign框架，dubbo框架,mybatis框架底层用到动态代理
    @Autowired
    UserAPIFeignClient userAPIFeignClient; //调用微服务提供者

    @GetMapping("/createBill")
    public String createBill(){
        UserQuery userQuery = new UserQuery();
        userQuery.setUserId("002");
        String result = userAPIFeignClient.getVehicle(userQuery);
        return result;
    }
}
